<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>then 方法 catch</title>
</head>
<body>
    <script>
        // catch my breath
        let p = new Promise((resolve, reject) => {
            // resolve('ok');
            // resolve();
            reject('出错啦~~');
        });

        //catch 用来指定 promise 实例对象失败的回调
        p.catch(reason => {
            console.log(reason);
        });
        
    </script>
</body>
</html>